Block-based programming is programming within an environment where instructions are mainly represented as blocks. Block-based programming is also referred to as block-based coding, block modality, graphical programming, and visual programming language. Examples of block-based programming languages include Scratch, Modkit, ROBOTC Graphical, and many others. Blocks normally consist of one or more declarations and statements. In most block-based programming languages, blocks can be nested within other blocks. Blocks are fundamental to structured programming, in which control structures are created from blocks.
The purpose of blocks in programming is to enable groups of statements to be treated as if they were one statement, represented by a block, and to narrow the lexical scope of variables, procedures and functions declared within a block. Additionally, the interface of block-based programming languages allows programs to be written by dragging and dropping the blocks into an editor in a manner representing the building of a puzzle. The goal of these features is to lower the barrier of entry for novice programmers as they begin learning computer science.
While block-based programming was created with novice programmers in mind, professionals today are still using a text-based programming language. As opposed to dragging and dropping blocks, text-based programming is the process of typing letters, numbers and symbols. Text-based programming, also referred to as text modality, used in programming language such as C, Javascript and Python, requires programmers to utilize formal syntax to compile a program.
Why is studying block modality important? Structuration is defined by the relationship between the representational infrastructure used within a knowledge domain and the knowledge and understanding that the infrastructure enables and promotes. This relationship is not static, so it is important that there is a clear understanding of what learning block modality is enabling and promoting. This is why studying blocks-based modality is so important.
Why is block modality so popular? In a prior art study where students were able to choose their modality, students overwhelmingly used the block-based modality. The transition from block to text is not a one-direction shift, but instead students move back and forth over time. Any time students wanted to use a new command or a more complex command, they used blocks.
Block modality encourages users to quickly create, compile and then test their programs. The research refers to the block-based modality as having a tight edit-execute cycle. This means relying more on productive programming processes, as students are given immediate feedback.
As such one can imagine there are quite a few typical environments to assist users in block programming. Prior Art FIG. 1 shows in the prior art one example of a typical block programming environment 10 with blocks 12 in the left toolbar 14 and a working area 16 on the right side of the environment 10. Blocks 12 on the left toolbar can be dragged into the workspace on the right. New blocks 12″ when placed typically snap to nearby existing blocks 12′. Once in the working area 16 the code blocks form a computer program. FIG. 1 is an example of the Modkit editor for VEX that is based on Scratch by MIT.
In another example, Prior Art FIG. 2 shows another prior art environment 20 BBC Micro:Bit editor and language that is based on Blockly. In yet another example, Prior Art FIG. 3 shows the known environment 30 Google Blockly, which incorporates a toolbar 32 on the left side of the environment 34. Google Blockly has a middle panel 36 that contains the block working area and has a right panel 38 that contains the complete final code that is equivalent to the block. Lastly, Prior Art FIG. 4 is an example of the Sublime text editor environment 40 showing C++ code.
However, there are challenges in the above programming approach, especially in transitioning between block modality and text modality. Some of these challenges are:                Readability—Students find it much easier to read and understand a block of code when it is written in block modality, a more “natural” language.        Commands memorization—in block modality, novices can browse all available commands, but in text modality, students often have to memorize commands. Additionally, there is normally a larger library of text commands.        Syntax Memorization—in text modality, students have to memorize syntax.        Input Flexibility—typing/spelling is required in text modality, but not in block modality.        Prototypes versus Definition—in block modality, when a user drags a command into a loop, uses a function (myblocks in Scratch or Line Following in ROBOTC Graphical) or does something more advanced, like broadcasting a message, the user just has to manipulate the parameters within that block. In text-based modality, programmers have to construct all of this syntax on their own. This includes the order of the commands, what syntax to use with those commands, matching variable types, etc.        Matching Identifiers—block modalities handle this for users, usually with drop-down menus, whereas in text modality, the user has to match on their own.        Defining Scope—missing or extra brackets in languages that define scope with explicit symbols is one of the most common errors with beginning programmers. Research says that knowing how to control scope is not enough; the mechanics of arranging and maintaining scope is still challenging.        Writing Expressions—expressions are provided for students in block modality. They have to be written, and written correctly, in text modality.        Data types—students do not have to use or understand data types with block modality.        Error Messages—with block modality, students get little practice with interpreting error messages.        Formatting—with block modality, students don't have to use manage their layout with things like whitespace and indentation.        Improved Programming Approach—block modality encourages a bottom-up programming approach (identify lower-level tools that you can compose to become a bigger program). Students do worse on logic-based questions on AP CS exam than on any other type of question.        Improved Comprehension—students do not have a deep understanding of how loops work, what variables are, and what they do in a programming context after programming in block modality. Blocks help students understand what a command does, not how to transfer that knowledge to different applications.        Syntax—students still have to deal with syntax when experiencing text modality for the first time. Using block modality does not solve this transition issue.        
In additionally there are several problems when using variables, expressions, and loops that have been previously reported. Specifically, students have problems with assigning variables that need to assume multiple values at the same time. Distinguishing between what goes inside of a loop and what precedes or follows a loop, and that an expression involving the control variable of a loop can have different values in each cycle of the loop causes problems.
As such a need exists to help . . . .